package com.markyao.controller.recos;

import com.markyao.service.db.HisConfigService;
import com.markyao.vo.ConfigInfoVo;
import com.markyao.vo.QueryParams;
import com.markyao.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/recos/hisconfiginfo")
public class HisConfigInfoController {
    @Autowired
    HisConfigService hisConfigService;

    @PostMapping("list")
    public Result list(@RequestBody QueryParams queryParams){
        return hisConfigService.selectList(queryParams);
    }

    @GetMapping("getOne/{id}")
    public Result getOne(@PathVariable("id") String id){
        QueryParams queryParams = new QueryParams();
        queryParams.setId(id);
        ConfigInfoVo configInfoVo = hisConfigService.selectOne(queryParams);
        return Result.success(configInfoVo);
    }

    @GetMapping("rollback/{id}")
    public Result rollback(@PathVariable("id") String id){
        return hisConfigService.rollback(id);
    }
    @PostMapping("delete")
    public Result deleteBatch(@RequestBody String[] ids){

        return hisConfigService.deletes(ids);
    }

}
